<?php
/**
 * Created by 2019/4/12 0012
 * Effect: RedisKey.php
 * Author: 品花
 * Date: 2019/4/12 0012
 * Time: 上午 10:01
 */

namespace App\Consts;


class RedisKey
{
    //短信验证码缓存时间
    const LOGIN_PHONE_CODE_TIMEOUT = 960 ;
    //登录会话超时
    const LOGIN_SESSION_OUTTIME  = 864000;

    //图形验证码
    const LOGIN_IMAGE_CODE = 'login_image_code:%s';
    //短信验证码key
    const LOGIN_PHONE_CODE_KEY = 'login_phone_code_key:%s';
    //用户token
    const LOGIN_USER_TOKEN = 'login_user_token:%s';

    //在线FD和客户端唯一标识关系
    const WS_USER_FD_HASH_LIST = "ws_user_fd_hash_list";

    const VIOLATION_IP_RECORD = "violation_ip_record:";

    const IP_PRISON = "prison";

    //用户权限列表
    const USER_AUTHORITY_LIST = 'USER_AUTHORITY_LIST:%s';
    //用户表
    const USER_INFO_HASH = 'user_info_hash';
    //系统配置
    const SYSTEM_CONFIG = 'system_config';


    //================首页================
    //当前房间状态  -1还未开放,0暂未房主,1投注中，2封盘中，3.开奖中

    //游戏状态变更
    const ROOM_STATUS_UPDATE  = 'room_status_update';


    //谷歌验证码
    const GV_CODE = 'gv_code';


    //登陆用户的token
    static function loginUserToken($uid){

        return sprintf(self::LOGIN_USER_TOKEN,$uid);
    }
    static function login_phone_code_key($mobile){
        return sprintf(self::LOGIN_PHONE_CODE_KEY,$mobile);
    }
    static function login_image_code($sessid){
        return sprintf(self::LOGIN_IMAGE_CODE,$sessid);
    }
    static function user_authority_list($role_id){
        return sprintf(self::USER_AUTHORITY_LIST,$role_id);
    }


}